package com.yflutter.yfree_app

import com.yflutter.yfree_app.activity.MainActivity
import com.yflutter.yfree_app.lib.YFree.YUniappPlugin
import com.yfree.YConfig
import com.yfree.application.YApplication
import io.flutter.FlutterInjector

class MyApplication : YApplication() {
    companion object {
        lateinit var mainFlutterActivity: MainActivity
    }

    override fun onYConfig() {
        YConfig.restartActivity = MainActivity::class.java
        YConfig.PROJECTBASEDIR = "/YFree_App"
        YConfig.statubar = R.drawable.statubar
    }

    override fun onYCreated() {
        FlutterInjector.instance().flutterLoader().startInitialization(applicationContext)
    }

    override fun onYOnceCreated() {
        YUniappPlugin.yInit(this)
    }
}
